﻿using System;
using SqlSugar;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Threading.Tasks;
using System.Security.Principal;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using MongoDB.Bson.Serialization.Attributes;
using FrameWork.Data.Mapping;

namespace FrameWork.Data.ViewObject
{
    public class TestLoopData : ModelBase
    {
        private long _TestRecordId;
        [Description("测试记录编号")]
        public long TestRecordId
        {
            get { return _TestRecordId; }
            set { _TestRecordId = value; OnPropertyChanged(nameof(TestRecordId)); }
        }
        private int _LoopIndex;
        /// <summary>
        /// 循环号
        /// </summary>
        [Description("循环序号")]
        public int LoopIndex
        {
            get { return _LoopIndex; }
            set { _LoopIndex = value; OnPropertyChanged(nameof(LoopIndex)); }
        }
        private double? _Capacity;
        /// <summary>
        /// 容量
        /// </summary>
        [Description("容量")]
        public double? Capacity
        {
            get { return _Capacity; }
            set { _Capacity = value; OnPropertyChanged(nameof(Capacity)); }
        }
        private double? _ChargeCapacity;
        /// <summary>
        /// 充电容量
        /// </summary>
        [Description("充电容量")]
        public double? ChargeCapacity
        {
            get { return _ChargeCapacity; }
            set { _ChargeCapacity = value; OnPropertyChanged(nameof(ChargeCapacity)); }
        }
        /// <summary>
        /// 放电容量
        /// </summary>
        private double? _DischargeCapacity;
        [Description("放电容量")]
        public double? DischargeCapacity
        {
            get { return _DischargeCapacity; }
            set { _DischargeCapacity = value; OnPropertyChanged(nameof(DischargeCapacity)); }
        }
        /// <summary>
        /// 充电累计容量
        /// </summary>
        private double? _ChargeAccCapacity;
        [Description("充电累计容量")]
        public double? ChargeAccCapacity
        {
            get { return _ChargeAccCapacity; }
            set { _ChargeAccCapacity = value; OnPropertyChanged(nameof(ChargeAccCapacity)); }
        }
        /// <summary>
        /// 放电累积容量
        /// </summary>
        private double? _DischargeAccCapacity;
        [Description("放电累积容量")]
        public double? DischargeAccCapacity
        {
            get { return _DischargeAccCapacity; }
            set { _DischargeAccCapacity = value; OnPropertyChanged(nameof(DischargeAccCapacity)); }
        }
        private double? _Energy;
        /// <summary>
        /// 能量
        /// </summary>
        [Description("能量")]
        public double? Energy
        {
            get { return _Energy; }
            set { _Energy = value; OnPropertyChanged(nameof(Energy)); }
        }
        /// <summary>
        /// 充电能量
        /// </summary>
        private double? _ChargeEnergy;
        [Description("充电能量")]
        public double? ChargeEnergy
        {
            get { return _ChargeEnergy; }
            set { _ChargeEnergy = value; OnPropertyChanged(nameof(ChargeEnergy)); }
        }
        /// <summary>
        /// 放电能量
        /// </summary>
        private double? _DischargeEnergy;
        [Description("放电能量")]
        public double? DischargeEnergy
        {
            get { return _DischargeEnergy; }
            set { _DischargeEnergy = value; OnPropertyChanged(nameof(DischargeEnergy)); }
        }
        /// <summary>
        /// 充电累积能量
        /// </summary>
        private double? _ChargeAccEnergy;
        [Description("充电累积能量")]
        public double? ChargeAccEnergy
        {
            get { return _ChargeAccEnergy; }
            set { _ChargeAccEnergy = value; OnPropertyChanged(nameof(ChargeAccEnergy)); }
        }
        /// <summary>
        /// 放电累积能量
        /// </summary>
        private double? _DischargeAccEnergy;
        [Description("放电累积能量")]
        public double? DischargeAccEnergy
        {
            get { return _DischargeAccEnergy; }
            set { _DischargeAccEnergy = value; OnPropertyChanged(nameof(DischargeAccEnergy)); }
        }
        /// <summary>
        /// 充电终了电压
        /// </summary>
        private double? _ChargeEndVoltage;
        [Description("充电终了电压")]
        public double? ChargeEndVoltage
        {
            get { return _ChargeEndVoltage; }
            set { _ChargeEndVoltage = value; OnPropertyChanged(nameof(_ChargeEndVoltage)); }
        }
        /// <summary>
        /// 放电终了电压
        /// </summary>
        private double? _DischargeEndVoltage;
        [Description("放电终了电压")]
        public double? DischargeEndVoltage
        {
            get { return _DischargeEndVoltage; }
            set { _DischargeEndVoltage = value; OnPropertyChanged(nameof(_DischargeEndVoltage)); }
        }
        /// <summary>
        /// 效率
        /// </summary>
        private double? _Efficiency;
        [Description("效率")]
        public double? Efficiency
        {
            get { return _Efficiency; }
            set { _Efficiency = value; OnPropertyChanged(nameof(_Efficiency)); }
        }
        /// <summary>
        /// 能量效率比
        /// </summary>
        private double? _EnergyEfficiencyRate;
        [Description("能量效率比")]
        public double? EnergyEfficiencyRate
        {
            get { return _EnergyEfficiencyRate; }
            set { _EnergyEfficiencyRate = value; OnPropertyChanged(nameof(_EnergyEfficiencyRate)); }
        }

        /// <summary>
        /// 放电时间
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "放电时间")]
        public double? DischargeTime { get; set; }
        /// <summary>
        /// 充电时间
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "充电时间")]
        public double? ChargeTime { get; set; }
        /// <summary>
        /// 放电系统终止时间
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "放电系统终止时间")]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime? DischargeSystemEndTime { get; set; }

        /// <summary>
        /// 压差
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "压差")]
        public double? VoltageDiff { get; set; }
        /// <summary>
        /// 容量保持率
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "容量保持率")]
        public double? CapacityKeepRate { get; set; }
        /// <summary>
        /// 放电中值电压
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "放电中值电压")]
        public double? DischargeMidVolt { get; set; }
        /// <summary>
        /// 充电中值电压
        /// </summary>
        [SugarColumn(IsNullable = true, DecimalDigits = 6, ColumnDescription = "充电中值电压")]
        public double? ChargeMidVolt { get; set; }


        #region ___协助属性___
        private bool _IsExpanded;
        [BsonIgnore]
        public bool IsExpanded
        {
            get { return _IsExpanded; }
            set { _IsExpanded = value; OnPropertyChanged(nameof(IsExpanded)); }
        }
        private ObservableCollection<TestStepData> _ListTestStepData;
        [BsonIgnore]
        public ObservableCollection<TestStepData> ListTestStepData
        {
            get { return _ListTestStepData; }
            set { _ListTestStepData = value; OnPropertyChanged(nameof(ListTestStepData)); }
        }
        private TestStepData _SelectTestStepData;
        /// <summary>
        /// 选中工部
        /// </summary>
        [BsonIgnore]
        public TestStepData SelectTestStepData
        {
            get { return _SelectTestStepData; }
            set { _SelectTestStepData = value; OnPropertyChanged(nameof(SelectTestStepData)); }
        }
        /// <summary>
        /// 是否接续循环
        /// </summary>
        [BsonIgnore]
        [SugarColumn(IsIgnore = true, ColumnDescription = "是否接续循环")]
        public bool IsSplicing { get; set; }
        #endregion
    }
}